﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SuperMarket.BLL;
using SuperMarket.Model;

namespace SuperMarket
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btndl_Click(object sender, EventArgs e)
        {
            string name = txtname.Text;
            string pass = txtpwd.Text;
            AdminManager am = new AdminManager();

            AdminInfo admin = am.UserLogin(name, pass);
            if (admin != null)//判断是否查询到数据
            {
                MessageBox.Show("登录成功");
            }
            else
            {
                MessageBox.Show("登录失败，用户名或者密码错误");
            }
        }
    }
}
